def prepare_config(config_file='config.txt', new_config_file='config.txt', ligand='ligand'):
    with open(config_file) as config:
        lines = config.readlines()
        receptor = lines[0].strip()
        size = lines[2].split()
        center = lines[3].split()
    with open(new_config_file, 'w') as new_config:
        new_config.write('receptor = ' + receptor + '.pdbqt\n')
        new_config.write('ligand = ' + ligand + '.pdbqt\n')
        new_config.write('\n')
        new_config.write('size_x = ' + size[1] + '\n')
        new_config.write('size_y = ' + size[2] + '\n')
        new_config.write('size_z = ' + size[3] + '\n')
        new_config.write('center_x = ' + center[1] + '\n')
        new_config.write('center_y = ' + center[2] + '\n')
        new_config.write('center_z = ' + center[3] + '\n')


if __name__ == '__main__':
    prepare_config('test/dock/config.txt', 'test/dock/new_config.txt')
